package com.itheima.yanshi;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Demo02 {

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
        Dancer dancer = new Dancer();
      //  dancer.dance();
        Class<? extends Dancer> clazz = Dancer.class;
        Method dance = clazz.getDeclaredMethod("dance");
        dance.setAccessible(true);
        dance.invoke(dancer);


    }
}
